
###############################################
########## JEPS OPTIMAL PERSUASION ############
###############################################

Optimal Persuasion under Confirmation Bias: Theory and Evidence from a Registered Report
Journal of Experimental Political Science
Author: Love Christensen
Website: lovechristensen.com
Contact: love.christensen@gmail.com


This folder contains a description of the replication material for 'Optimal Persuasion under Confirmation Bias: Theory and Evidence from a Registered Report.'

## 1. File Structure

For the script to run successfully, please ensure that the following folder structure/work flow is in place:
A parent directory containing:
	(a) a folder titled "data", containing the data set "opcb_080221.dta"
	(b) a folder titled "output" which itself contains two folders titled "tables" and "figures"
	(c) a folder titled "script", containing three files with R script.

All tables and figures produced in the script are written to output/tables and output/figures, respectively.

This replication material only includes the code for replicating the experimental analysis. It does not include the code needed to generate 
	(a) the figures illustrating the theoretical model (Figure 1, Appendix Figure 1, Appendix Figure 11)
	(b) tables with hypothesis tests (Appendix Table 5, Appendix Table 6, Appendix Table 7)
	(c) CONSORT flow chart, but the calculation of the N is included in the replication material (Appendix Figure 9)
	(d) figures summarising the power analysis (Appendix Figure 12, Appendix Figure 13).
All this information is available from the author upon request.

## 2. File Information

There are four script files:

	1. 1_experiment_prep_and_analysis.R
	2. 2_experiment_tables.R
	3. 3_experiment_graphs.R
	4. 4_illustrations_power_analysis.R

The first file contains the data preparation and all the models. This script needs to be run before 2_experiment_tables.R and 3_experiment_graphs.R, since the two latter files call models from the fist file. 2_experiment_tables.R contains the code for creating the tables and 3_experiment_graphs.R contains the code for creating the graphs.

The last file, 4_illustrations_power_analysis.R contains the code for the figures illustrating the theoretical model (both in the main paper and the appendix) and the code for the power analysis and the Monte Carlo analysis of model selection. Please beware that the power analysis and model selection exercise takes a couple of days to run.

Please note that all tables and graphs are outputed as .tex files to be directly read and compiled in the latex file. The tables are written in the standard latex table format while the graphs are written as tikz files. Of course, the graphs can be written to more conventional formats, such as .jpg or .png, or be inspected directly in R.

The data folder contains the data set in Stata 13 format: "opcb_080221.dta."

## 3. Codebook for opcb_080221.dta

Below are annotations for the variables included in the data set. For full question wordings and scales, please see the online appendix.

*** Metadata ***

startdate - start of survey
enddate - end of survey
durationinsecond - duration of survey

*** Screener Battery Questions ***

issues - understanding of important policies issues 
trust - most people can be trusted
satisfaction - satisfaction with democracy
screener_1 - select somewhat disagree
screener_2 - select strongly agree

[strongly disagree (1), 2, ..., strongly agree (5)]

*** Prior Beliefs ***

tpp_prior_qual - prior belief of about effect of TPP
	[increase (1), stay the same (2), decrease (3)]

tpp_prior_quant_1 - quantitative prior belief about effect of tpp 
	[changes of million manufacturing jobs]

tpp_prior_cert - certainty of prior belief 
	[highly uncertain (1), 2, 3, 4, highly certain (5)]

*** Partisanship ***

pid - republican (1), democrat (2), independent (3), other (4)
pid_strength - (1) strong, (2) not very strong
pid_lean - (1) lean republican, (2) lean democrat, (3) neither

*** Ideology ***

lc_ideology - liberal-conservative self-placement 
	[extremely liberal (1), 2, ..., extremely conservative (7)]

trade_ideology - nativist outlook 
	[US should focus on own problems (1), 2, ..., US should focus on international problems (7)]

*** Experimental Outcomes ***

prediction_cred - perceived credibility of prediction 
	[(1) not at all credible, 2, ..., (10) very credible]

tpp_post_quant_1 - quantitative posterior belief about effect of tpp 
	[changes in millions of manufacturing jobs]

tpp_attitude - support for TPP
	[(1) strongly oppose, 2, ..., 7 strongly favor]

*** Treatment Variables ***

party - which party is sender
preddist - prediction distance value [0, 1, ..., 30]
preddistvalue - prediction distance value in millions of jobs [0, 0.1, ..., 3]
prior - same as tpp_prior_quant_1 used for constructing treatment
prediction - value of actual prediction that respondents were exposed to

*** Constructed in 1_experiment_prep_and_analysis.R ***

diff - updating in millions of jobs
preddist_cut - binned treatment variable
copartisan - dummy indicating whether sender is copartisan
certain - dummy indicating whether certainty of prior belief is at least strong
republican - dummy indicating republican partisanship
democrat - dummy indicating democrat partisanship
rep_sender - dummy for Republican sender
dem_sender - dummy for Democrat sender
